package com.demo.demo01.controller;

import com.demo.demo01.mapper.ReplyMapper;
import com.demo.demo01.pojo.Reply;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ReplyController {
    @Autowired
    private ReplyMapper replyMapper;

    @GetMapping("/queryReplyListByCode")
    public List<Reply> queryReplyListByCode(String code){
            List<Reply> replyList = replyMapper.queryReplyListByCode(code);
            System.out.println(replyList);
        return replyList;
    }

    @GetMapping("/deleteReply")
    public int deleteReply(String code, String num){
        return replyMapper.deleteReply(code, num);
    }

    @GetMapping("/addReply")
    public int addReply(Reply reply){
        return replyMapper.addReply(reply);
    }
}
